<?php

namespace App\Http\Controllers\api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class Category extends Controller
{
    public function getCategory() {
        $category = DB::table('category')->orderByRaw('cat_sort ASC')->get()->toArray();
        if ($category) {
            return returnData('800', '获取成功', $category);
        } else {
            return returnData('804', '无数据', '');
        }
    }
}
